<%@ page import="main.www.wonderfuldata.bean.User2" %>
<%@ page import="main.www.wonderfuldata.com.StatementTest" %>
<%@ page import="main.www.wonderfuldata.PreparedStatement.PreparedStatementTest" %><%--
  Created by IntelliJ IDEA.
  User: gby0564
  Date: 2022/4/25
  Time: 11:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册界面</title>
</head>
<body>



<%
    String nameRegister = request.getParameter("nameRegister");
    String passwordRegisterFirst = request.getParameter("passwordRegisterFirst");
    String passwordRegisterSecond = request.getParameter("passwordRegisterSecond");

    if(passwordRegisterFirst.equals(passwordRegisterSecond) == false){
        System.out.println("两次输入的密码不一样");
        response.setHeader("Refresh","2;url=index.html");
    }else {
        PreparedStatementTest st = new PreparedStatementTest();

        String sql = "insert into User(name,password) values(?,?)";

        //执行sql文件
        st.update(sql,nameRegister,passwordRegisterFirst);
    }


%>

</body>
</html>
